GBML manual / Constants

EASE_BOUNCE_OUT

Falls to the end like a dropped ball and bounces three more times, each smaller than the last, until it rests. Never goes past the end.

Syntax

EASE_BOUNCE_OUT: constant

Description

The "bounce out" curve for tween and tween_to: a dropped ball. It falls to the end, hits it, and bounces back up three times, each bounce a quarter as tall as the one before, until it rests. After a quarter of the time it is at 0.47, after half at 0.77, and after three quarters at 0.97.

It never goes outside the range

Unlike back and elastic, a bounce never goes outside the range from from to to. The ball touches the end four times (a little over a third of the way through, then at about three quarters, then at about nine tenths, and then at the very end) and between the touches it comes back up by a quarter, a sixteenth and a sixty-fourth of the distance. It never goes past to, so it is safe to use on a number with limits.

It lands exactly on to and stays there: after the end the number is exactly to, every frame.

A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball drops to the green line like a dropped ball and bounces back up three times, each bounce smaller than the last, before it rests on the line. The in row is the same thing the other way round: small hops off the dim line that get taller, and then a drop to the green line. The in out row bounces away from the start and then into the end. No ball ever goes below the green line or above the dim one. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball drops to the green line like a dropped ball and bounces back up three times, each bounce smaller than the last, before it rests on the line. The in row is the same thing the other way round: small hops off the dim line that get taller, and then a drop to the green line. The in out row bounces away from the start and then into the end. No ball ever goes below the green line or above the dim one. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.
A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball drops to the green line like a dropped ball and bounces back up three times, each bounce smaller than the last, before it rests on the line. The in row is the same thing the other way round: small hops off the dim line that get taller, and then a drop to the green line. The in out row bounces away from the start and then into the end. No ball ever goes below the green line or above the dim one. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.

The same tween three ways, one row for each of EASE_BOUNCE_IN, EASE_BOUNCE_OUT and EASE_BOUNCE_IN_OUT. The ball's height is the number (like tween_to(y, ...) moving something down), and it drifts right at a steady speed only so that the shape can be seen. The dim line is where the number starts and the green line is where it ends: the ball touches the green line but never goes below it. Real pictures from a Game Boy Advance ROM, 4 frames apart, played at the speed of the console. A viewer that does not animate shows the first picture, the finished one.

Example

tween_to(y, y + 80, 60, EASE_BOUNCE_OUT);

y grows downward, so the walker falls 80 pixels, hits the ground, bounces back up 20 pixels, falls again, bounces up 5, then about 1, and rests exactly 80 pixels below where it began.

The one most people want: things that land (a coin dropped on a table, a ball, a title that drops into place and settles). It also looks right for a number that arrives and bounces, like a score counter.

See also: tweentween_totween_from_to